home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / addext / addext.cb
Text File  |  1990-09-25  |  446b  |  25 lines

  1. /* Put this in a file called addext.cb and compile it. */
  2. /* Then, put a -maddext in your bflags  */
  3. addext()
  4. {
  5.    register_macro(6, "add_c");
  6.    add_c();
  7. }
  8.  
  9. add_c()
  10. {
  11.    string fname, ext, new_name;
  12.  
  13.    int old_buf, new_buf;
  14.  
  15.    pause_on_error(1);
  16.    inq_names(fname, ext);
  17.    if (ext == "")
  18.    {
  19.       new_name = fname+".c";
  20.       old_buf = inq_buffer();
  21.       edit_file(new_name);
  22.       delete_buffer(old_buf);
  23.    }
  24. }
  25.